﻿//双击事件
function CustomDbClick() {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    document.getElementById("EditUIWindow").src = "../../TR/SelectCoursePlan.aspx?id=" + record.getData(const_entityID);
    YAHOO.example.container.dialog1.show();
    //    document.getElementById('dialog1_h').innerText = "课程计划详情";
    //    document.getElementById('yui-gen7-button').style.display = "none";
}

if (typeof ($) != "undefined") {
    $(document).ready(function () {
        try {
            var varStr = $("form").attr("action");
            var arr = varStr.split('&');
            var arr2 = new Array();
            for (var i = 1; i < arr.length; i++) {
                arr2.push(arr[i]);
            }
            var varCheck = arr2[0].substring(7, arr2[0].length);
            if (varCheck == "check") {
                $("#fieldForm").wrap("<span id='wrap'></span>");
                var obj = document.getElementById("wrap");
                obj.onmouseover = function () {
                    obj.setCapture();
                }
                obj.onmouseout = function () {
                    obj.releaseCapture();
                }
                obj.onfocus = function () {
                    obj.blur();
                }
                obj.onbeforeactivate = function () {
                    return false;
                }
            }
        } catch (Error) { }
    })
}

//课程计划总结
var fnCourseSum = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    document.getElementById("EditUIWindow").src = "../../TR/SelectCoursePlan.aspx?id=" + record.getData(const_entityID);
    YAHOO.example.container.dialog1.show();
}

var formatText = function (elCell, oRecord, oColumn, sData) {
    if (sData.length > 30) {
        elCell.innerHTML = sData.substring(0, 30)+"...";
    }
    else {
        elCell.innerHTML = sData;
    }
};